window.getUser = () => {
    try {
        return localStorage.user ? JSON.parse(localStorage.user) : null;
    } catch (e) {
        console.error('解析用户数据失败:', e);
        return null;
    }
};